﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="AdminControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint.ApplicationPages.Administration" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="~/_controltemplates/15/InputFormSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" src="~/_controltemplates/15/InputFormControl.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" src="~/_controltemplates/15/ButtonSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="TemplatePickerControl" src="~/_controltemplates/15/TemplatePickerControl.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ContentDatabaseSection" src="~/_admin/ContentDatabaseSection.ascx" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MoveSPSite.aspx.cs" Inherits="SPContentDatabaseManager.Layouts.SPContentDatabaseManager.MoveSPSite" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <!-- 
        Copyright 2014, Ryan Dennis
        ryan@sharepointryan.com
        www.sharepointryan.com
        @SharePointRyan on Twitter
        Ryan works for Blue Chip Consulting Group, www.bluechip-llc.com
        All code is provided with no warranty or guarantees.
        Visit the codeplex site: https://spcontentdbmanager.codeplex.com

        Feel free to modify this code, but please leave this section in to give the original author credit.
    -->
    <link rel="Stylesheet" href="SPCDMStyles.css" />
</asp:Content>
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <table class="spcdm-primaryTableFull" cellpadding="1">
        <tr>
            <td class="ms-standardheader ms-inputformheader spcdm-halfWidth">Site Collection</td>
            <td class="ms-authoringcontrols">
                <SharePoint:SiteAdministrationSelector UseDefaultSelection="false" runat="server" OnContextChange="SiteCollectionOnLoad" ID="SelectedSiteCollection" OnLoad="SiteFromQueryString" AllowChange="true"/>
            </td>
        </tr>
        <tr>
            <td class="ms-descriptiontext ms-inputformdescription spcdm-halfWidth">Select a site collection.</td>
        </tr>
    </table>
    <table class="spcdm-primaryTableFull" cellpadding="1">
        <tr>
            <td class="ms-standardheader ms-inputformheader spcdm-halfWidth">Site Details</td>
            <td class="ms-authoringcontrols">
                Current Database: <asp:Label ID="CurrentDatabase" runat="server" />
                <br/>
                Storage Used: <asp:Label ID="CurrentSiteUsage" runat="server" />
            </td>
        </tr>
        <tr>
            <td class="ms-standardheader ms-inputformheader spcdm-halfWidth">Choose Database</td>
            <td class="ms-authoringcontrols spcdm-halfWidth">
                <asp:DropDownList id="DatabaseSelector" runat="server" OnLoad="DatabaseSelector_OnLoad" OnSelectedIndexChanged="OnDbChange" AutoPostBack="true" />
            </td>
        </tr>
        <tr>
            <td class="ms-descriptiontext ms-inputformdescription spcdm-halfWidth">Specify the destination content database for the specified site collection.<br/></td>
        </tr>
    </table>
    <table class="ms-listviewtable spcdm-dbDetailsTbl" cellpadding="1" id="dbDetailsTbl" cellspacing="0">
        <tr>
            <td class="ms-standardheader ms-inputformheader spcdm-fullWidth"><br/>Destination Database Details</td>
        </tr>
        <tr class="ms-viewheadertr">
            <th class="ms-vh2" scope="col">Name</th>
            <th class="ms-vh2" scope="col">Status</th>
            <th class="ms-vh2" scope="col">Read-Only</th>
            <th class="ms-vh2" scope="col">Site Count</th>
            <th class="ms-vh2" scope="col">Max Site Count</th>
            <th class="ms-vh2" scope="col">Size</th>
        </tr>
        <tr class="ms-alternatingstrong">
            <td class="ms-vb2"><asp:Label ID="DestDatabaseName" runat="server" CssClass="tableSpan" /></td>
            <td class="ms-vb2"><asp:Label ID="DestDatabaseStatus" runat="server" CssClass="tableSpan" /></td>
            <td class="ms-vb2"><asp:Label ID="DestDatabaseReadOnly" runat="server" CssClass="tableSpan" /></td>
            <td class="ms-vb2"><asp:Label ID="DestDatabaseSiteCount" runat="server" CssClass="tableSpan" /></td>
            <td class="ms-vb2"><asp:Label ID="DestDatabaseMaxSiteCount" runat="server" CssClass="tableSpan" /></td>
            <td class="ms-vb2"><asp:Label ID="DestDatabaseSize" runat="server" CssClass="tableSpan" /></td>
        </tr>
    </table>
    <table class="spcdm-primaryTableFull" cellpadding="1">
        <tr>
            <td class="ms-descriptiontext ms-inputformdescription spcdm-fullWidth"><br/><br/>
                <hr /><strong>Important: </strong>The specified site collection and all its contents will be moved to the specified destination site collection. 
                Depending on the size of the site collection, this operation can take a while.
                A no-access lock is applied to the site collection to prevent users from altering data within the site collection while the move is taking place. 
                Once the move is complete, the site collection is returned to its original lock state. 
                The destination content database specified must already exist, must be attached to the same SQL Server as the site collection's current content database, and must be attached to the site collection's current Web Application. 
                To create a new content database, go to the <a href="/_admin/CNTDBADM.aspx">Content Databases</a> page.
                To view site collections by content database, go to the <a href="/_admin/SPContentDbMgr/ViewSPSites.aspx">View Site Collections by Database</a> page.

            </td>
        </tr>
    </table>
    <table class="spcdm-primaryTableFull" cellpadding="1">
        <tr>
            <td>
							 &nbsp;</td>
            <td class="ms-authoringcontrols spcdm-halfWidth">
                <asp:Button ID="OKbutton" runat="server" Text="OK" OnClick="OKbuttonClick" />
                <input type="button" class="ms-ButtonHeightWidth" value="Cancel" onclick="STSNavigate('\u002fapplications.aspx');" accesskey="C" />
            </td>
        </tr>
    </table>
    <table class="spcdm-primaryTableFull" cellpadding="1">
        <tr>
            <td class="ms-descriptiontext ms-inputformdescription spcdm-errorZone" id="errorTd">
                <asp:Label ID="errorNode" runat="server"/>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">Move Site Collection</asp:Content>
<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" Visible="true"><a href="/_admin/SPContentDbMgr/MoveSPSite.aspx">Move Site Collection</a></asp:Content>